-- 导入 wezterm 模块
local wezterm = require 'wezterm'

-- 配置表
local config = {}

-- ###########################
-- # 字体和字号配置
-- ###########################
config.font = wezterm.font_with_fallback({
    'Maple Mono NF CN',
    'JetBrains Mono',
    'Hack Nerd Font',
    'Noto Sans Mono CJK SC',
    'Noto Color Emoji',
})

config.font_size = 18.0

-- ###########################
-- # 启用连字功能
-- ###########################
config.harfbuzz_features = { 'calt=1', 'clig=1', 'liga=1' }

-- ###########################
-- # 外观配置
-- ###########################
config.enable_tab_bar = true
config.window_decorations = "INTEGRATED_BUTTONS|RESIZE"
config.window_padding = {
    left = 10,
    right = 10,
    top = 10,
    bottom = 10,
}

config.color_scheme = "Dracula (Official)"
config.tab_bar_at_bottom = true
config.use_fancy_tab_bar = false
config.window_decorations = "RESIZE"

config.window_background_opacity = 0.85
config.initial_cols = 120
config.initial_rows = 40

-- ###########################
-- # 快捷键：Split Pane
-- ###########################
local act = wezterm.action
config.keys = {
  -- 水平分割（左右分屏）
  {
    key = "H",
    mods = "ALT|SHIFT",
    action = act.SplitHorizontal { domain = "CurrentPaneDomain" },
  },
  -- 垂直分割（上下分屏）
  {
    key = "V",
    mods = "ALT|SHIFT",
    action = act.SplitVertical { domain = "CurrentPaneDomain" },
  },

  -- 在 pane 之间移动
  { key = "LeftArrow",  mods = "ALT", action = act.ActivatePaneDirection "Left" },
  { key = "RightArrow", mods = "ALT", action = act.ActivatePaneDirection "Right" },
  { key = "UpArrow",    mods = "ALT", action = act.ActivatePaneDirection "Up" },
  { key = "DownArrow",  mods = "ALT", action = act.ActivatePaneDirection "Down" },
}

-- 滚动条
config.enable_scroll_bar = true
config.scrollback_lines = 5000

-- 返回配置对象
return config

